/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#pragma once

#include <lib3d/hard/IndexBuffer.h>

#include <GLES/gl.h>
#include <GLES/glext.h>

namespace liba
{
namespace lib3d
{
namespace hard
{
namespace marmalade
{
		
class IndexBuffer : public hard::IndexBuffer
{
public:
	IndexBuffer();
	virtual ~IndexBuffer();
	virtual bool is_valid()const;
	virtual bool update( const int * indices, int indices_count );
	virtual bool render( int index_pos, int primitive_count, int vertex_pos, int vertex_count );
	
	int get_buffer()const
	{
		return index_buffer;
	}
	
	int get_indices_count()const
	{
		return indices_count;
	}
	
private:
	GLuint index_buffer;
	int indices_count;
	bool valid_flag;
};

} // namespace marmalade
} // namespace hard
} // namespace lib3d
} // namespace liba
using namespace liba;

